<extend name="Public:base"/>

<block name="main">
<script>
function edittpl(){
    var file= $('#tpl').val();
    url = "{:U('slide/edittpl')}&isajax=1&tpl="+file
    openwin("edittpl",url,"{:L(EDIT_TPL)}",700,550,true);
}
</script>

<div id="yzh-content" class="col-xs-12">
    <div class="main-title">
        <h2>编辑广告</h2>
    </div>

    <div class="dataTables_wrapper">
    <form name="myform" id="myform" class="form-horizontal" action="{:U('Slide/edit')}" method="post">

        <div class="form-group">
            <label class="control-label col-md-2"><font color="red">*</font>{:L(name)}</label>
            <div class="col-md-6">
                <input type="text" id="name" name="name" value="{$vo.name}" class="form-control"  validate="required:true,cn_username:true, minlength:2, maxlength:20"/>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-md-2">{:L(tpl)}</label>
            <div class="col-md-6">
                {:Form::select(array('field'=>'tpl','options'=>$Tpl,'options_key'=>'value,filename'),$vo['tpl'])}
                <a href="javascript:void(0);" onclick='edittpl();'>{:L(EDIT_TPL)}</a>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-md-2">{:L(width)}</label>
            <div class="col-md-6">
                <input type="text" id="width" name="width" value="{$vo.width}" class="form-control" validate="required:true,number:true, minlength:1, maxlength:20"/>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-2">{:L(height)}</label>
            <div class="col-md-6">
                <input type="text" id="height" name="height" value="{$vo.height}" class="form-control" validate="required:true,number:true, minlength:1, maxlength:20"/>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-2">{:L(num)}</label>
            <div class="col-md-6">
                <input type="text" id="height" name="num" value="{$vo.num}" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-2">{:L(STATUS)}</label>
            <div class="col-md-6">
                {:Form::radio(array('field'=>'status','options'=>array('1'=>L('enable'),'0'=>L('disable'))),$vo['status'])}
            </div>
        </div>

        <div class="form-actions">
            <if condition="$vo['id']!=''"><input type="hidden" name="id" value="{$vo.id}"/></if>
            <input type="submit" value="确认" class="btn btn-sm btn-primary" />
            <a href="{:U('Slide/index')}" class="btn btn-sm btn-primary">返回广告列表</a>
        </div>
    </form>
</div>
</block>